<!DOCTYPE html>
<html>
  <head>
  <meta charset='UTF-8'>
  <title>Atom API Documentation</title>
  <link rel='stylesheet' href='../assets/biscotto.css' type='text/css'>
  <script src='../assets/biscotto.js'></script>
  <script src='../assets/search_data.js'></script>
</head>
  <body>
    <div id='base' data-path='..&#47;'></div>
<div id='header'>
  <div id='menu'>
    <a href='../docs/README.md.html' title='Atom'>Atom</a>
    &raquo;
    <a href='../class_index.html' title='Index'>Index</a>
    &raquo;
    <span class='title'>Marker</span>
    <nav>
      <ul>
        <li class='noframes'>
          (<a class='noframes' href='Marker.html#'>no frames</a>)
        </li>
      </ul>
    </nav>
    <div id='search'>
      <a id='class_list_link' href='../class_list.html'>Classes</a>
      <a id='file_list_link' href='../file_list.html'>Files</a>
      <a id='method_list_link' href='../method_list.html'>Methods</a>
      <a id='extra_list_link' href='../extra_list.html'>Extras</a>
    </div>
  </div>
  <iframe id='search_frame'></iframe>
  <div id='fuzzySearch'>
    <input type='text'>
    <ol></ol>
  </div>
  <div id='help'>
    <p>
      Quickly fuzzy find classes, mixins, methods, file:
    </p>
    <ul>
      <li>
        <span>Ctrl-T</span>
        Open fuzzy finder dialog
      </li>
    </ul>
    <p>
      In frame mode you can toggle the list naviation frame on the left side:
    </p>
    <ul>
      <li>
        <span>Ctrl-L</span>
        Toggle list view
      </li>
    </ul>
    <p>
      You can focus a list in frame mode or toggle a tab in frameless mode:
    </p>
    <ul>
      <li>
        <span>Ctrl-C</span>
        Class list
      </li>
      <li>
        <span>Ctrl-I</span>
        Mixin list
      </li>
      <li>
        <span>Ctrl-F</span>
        File list
      </li>
      <li>
        <span>Ctrl-M</span>
        Method list
      </li>
      <li>
        <span>Ctrl-E</span>
        Extras list
      </li>
    </ul>
    <p>
      You can focus and blur the search input:
    </p>
    <ul>
      <li>
        <span>Ctrl-S</span>
        Focus search input
      </li>
      <li>
        <span>Esc</span>
        Blur search input
      </li>
    </ul>
    <p>
      In frameless mode you can close the list tab:
    </p>
    <ul>
      <li>
        <span>Esc</span>
        Close list tab
      </li>
    </ul>
  </div>
</div>
    <div id='content'>
      <h1>
        Class
        Marker
      </h1>
      <div class='stability-1'>
        <span class='heading'></span>
        <div class='message'></div>
      </div>
      <table class='box'>
        <tr>
          <td>Defined in:</td>
          <td>docs&#47;includes&#47;text-buffer&#47;src&#47;marker.coffee</td>
        </tr>
      </table>
      <h2>Overview</h2>
      <div class='docstring'>
  <p>Reprents a buffer annotation that remains logically stationary even as the buffer changes. This is used to represent cursors, folds, snippet targets, misspelled words, and anything else that needs to track a logical location in the buffer over time.</p><p>Head and Tail:
Markers always have a <em>head</em> and sometimes have a <em>tail</em>. If you think of a
marker as an editor selection, the head is the part that&#39;s stationary and the
tail is the part that moves when the mouse is moved. A marker without a tail
always reports an empty range at the head position. A marker with a head position
greater than the tail is in a &quot;normal&quot; orientation. If the head precedes the
tail the marker is in a &quot;reversed&quot; orientation.</p><p>Validity:
Markers are considered <em>valid</em> when they are first created. Depending on the
invalidation strategy you choose, certain changes to the buffer can cause a
marker to become invalid, for example if the text surrounding the marker is
deleted.</p><p>Change events:
When markers change in position for any reason, the emit a &#39;changed&#39; event with
the following properties:</p><ul>
<li>oldHeadPosition:
  A <a href='Point.html'>Point</a> representing the former head position</li>
<li>newHeadPosition:
  A <a href='Point.html'>Point</a> representing the new head position</li>
<li>oldTailPosition:
  A <a href='Point.html'>Point</a> representing the former tail position</li>
<li>newTailPosition:
  A <a href='Point.html'>Point</a> representing the new tail position</li>
<li>wasValid:
  A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether the marker was valid before the change</li>
<li>isValid:
  A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether the marker is now valid</li>
<li>hadTail:
  A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether the marker had a tail before the change</li>
<li>hasTail:
  A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether the marker now has a tail</li>
<li>oldProperties:
  An <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'>Object</a> containing the marker&#39;s custom properties before the change.</li>
<li>newProperties:
  An <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'>Object</a> containing the marker&#39;s custom properties after the change.</li>
<li>textChanged:
  A <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether this change was caused by a textual change
  to the buffer or whether the marker was manipulated directly via its public
  API. </li>
</ul>

</div>
<div class='tags'>
</div>
      <h2>Instance Method Summary</h2>
      <ul class='summary'>
  <li>
    <span class='signature'>
      <a href='Marker.html#clearTail-instance'>
        ::<strong>clearTail</strong>(properties)
      </a>
    </span>
    <span class='desc'>
      Removes the marker&#39;s tail.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#compare-instance'>
        ::<strong>compare</strong>(other)
      </a>
    </span>
    <span class='desc'>
      Compares this marker to another based on their ranges.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#copy-instance'>
        ::<strong>copy</strong>(params)
      </a>
    </span>
    <span class='desc'>
      Creates and returns a new <a href='Marker.html'>Marker</a> with the same properties as this marker.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#destroy-instance'>
        ::<strong>destroy</strong>()
      </a>
    </span>
    <span class='desc'>
      Destroys the marker, causing it to emit the &#39;destroyed&#39; event.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#getEndPosition-instance'>
        ::<strong>getEndPosition</strong>()
      </a>
    </span>
    <span class='desc'>
      Returns a <a href='Point.html'>Point</a> representing the end position of the marker, which could be the head or tail position, depending on its orientation.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#getHeadPosition-instance'>
        ::<strong>getHeadPosition</strong>()
      </a>
    </span>
    <span class='desc'>
      Returns a <a href='Point.html'>Point</a> representing the marker&#39;s current head position.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#getInvalidationStrategy-instance'>
        String ::<strong>getInvalidationStrategy</strong>()
      </a>
    </span>
    <span class='desc'>
      Get the invalidation strategy for this marker.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#getProperties-instance'>
        ::<strong>getProperties</strong>()
      </a>
    </span>
    <span class='desc'>
      Returns an <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'>Object</a> containing any custom properties associated with the marker.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#getRange-instance'>
        ::<strong>getRange</strong>()
      </a>
    </span>
    <span class='desc'>
      Returns the current <a href='Range.html'>Range</a> of the marker.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#getStartPosition-instance'>
        ::<strong>getStartPosition</strong>()
      </a>
    </span>
    <span class='desc'>
      Returns a <a href='Point.html'>Point</a> representing the start position of the marker, which could be the head or tail position, depending on its orientation.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#getTailPosition-instance'>
        ::<strong>getTailPosition</strong>()
      </a>
    </span>
    <span class='desc'>
      Returns a <a href='Point.html'>Point</a> representing the marker&#39;s current tail position.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#hasTail-instance'>
        ::<strong>hasTail</strong>()
      </a>
    </span>
    <span class='desc'>
      Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether the marker has a tail.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#isDestroyed-instance'>
        Boolean ::<strong>isDestroyed</strong>()
      </a>
    </span>
    <span class='desc'>
      Is the marker destroyed?
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#isEqual-instance'>
        ::<strong>isEqual</strong>(other)
      </a>
    </span>
    <span class='desc'>
      Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether this marker is equivalent to another marker, meaning they have the same range and options.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#isReversed-instance'>
        ::<strong>isReversed</strong>()
      </a>
    </span>
    <span class='desc'>
      Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether the head precedes the tail.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#isValid-instance'>
        Boolean ::<strong>isValid</strong>()
      </a>
    </span>
    <span class='desc'>
      Is the marker valid?
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#plantTail-instance'>
        ::<strong>plantTail</strong>(properties)
      </a>
    </span>
    <span class='desc'>
      Plants the marker&#39;s tail at the current head position.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#setHeadPosition-instance'>
        ::<strong>setHeadPosition</strong>(position, properties)
      </a>
    </span>
    <span class='desc'>
      Sets the head position of the marker.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#setProperties-instance'>
        ::<strong>setProperties</strong>(properties)
      </a>
    </span>
    <span class='desc'>
      Merges an <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'>Object</a> containing new properties into the marker&#39;s existing properties.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#setRange-instance'>
        ::<strong>setRange</strong>(range, properties)
      </a>
    </span>
    <span class='desc'>
      Sets the range of the marker.
    </span>
  </li>
  <li>
    <span class='signature'>
      <a href='Marker.html#setTailPosition-instance'>
        ::<strong>setTailPosition</strong>(position, properties)
      </a>
    </span>
    <span class='desc'>
      Sets the head position of the marker.
    </span>
  </li>
</ul>
      <h2>Instance Method Details</h2>
      <div class='methods'>
  <div class='method_details'>
    <p class='signature' id='clearTail-instance'>
      ::<strong>clearTail</strong>(properties)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Removes the marker&#39;s tail. After calling the marker&#39;s head position will be reported as its current tail position until the tail is planted again.</p>
</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='name'>properties</span>
      &mdash;
      <span class='desc'>An optional hash of properties to associate with the marker.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='compare-instance'>
      ::<strong>compare</strong>(other)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Compares this marker to another based on their ranges.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='copy-instance'>
      ::<strong>copy</strong>(params)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Creates and returns a new <a href='Marker.html'>Marker</a> with the same properties as this marker.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='destroy-instance'>
      ::<strong>destroy</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Destroys the marker, causing it to emit the &#39;destroyed&#39; event. Once destroyed, a marker cannot be restored by undo/redo operations.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getEndPosition-instance'>
      ::<strong>getEndPosition</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns a <a href='Point.html'>Point</a> representing the end position of the marker, which could be the head or tail position, depending on its orientation.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getHeadPosition-instance'>
      ::<strong>getHeadPosition</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns a <a href='Point.html'>Point</a> representing the marker&#39;s current head position.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getInvalidationStrategy-instance'>
      String ::<strong>getInvalidationStrategy</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Get the invalidation strategy for this marker.</p><p>Valid values include: <code>inside</code>, <code>never</code>, <code>overlap</code>, and <code>surround</code>.</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt>String</tt>)
      &mdash;
      <span class='desc'>Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'>String</a>.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getProperties-instance'>
      ::<strong>getProperties</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns an <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'>Object</a> containing any custom properties associated with the marker.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getRange-instance'>
      ::<strong>getRange</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns the current <a href='Range.html'>Range</a> of the marker. The range is immutable.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getStartPosition-instance'>
      ::<strong>getStartPosition</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns a <a href='Point.html'>Point</a> representing the start position of the marker, which could be the head or tail position, depending on its orientation.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='getTailPosition-instance'>
      ::<strong>getTailPosition</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns a <a href='Point.html'>Point</a> representing the marker&#39;s current tail position. If the marker has no tail, the head position will be returned instead.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='hasTail-instance'>
      ::<strong>hasTail</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether the marker has a tail.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='isDestroyed-instance'>
      Boolean ::<strong>isDestroyed</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Is the marker destroyed?</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt>Boolean</tt>)
      &mdash;
      <span class='desc'>Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a>.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='isEqual-instance'>
      ::<strong>isEqual</strong>(other)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether this marker is equivalent to another marker, meaning they have the same range and options.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='isReversed-instance'>
      ::<strong>isReversed</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a> indicating whether the head precedes the tail.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='isValid-instance'>
      Boolean ::<strong>isValid</strong>()
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Is the marker valid?</p>
</div>
<div class='tags'>
  <h3>Returns:</h3>
  <ul class='return'>
    <li>
      <span class='type'></span>
      (<tt>Boolean</tt>)
      &mdash;
      <span class='desc'>Returns a <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean'>Boolean</a>.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='plantTail-instance'>
      ::<strong>plantTail</strong>(properties)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Plants the marker&#39;s tail at the current head position. After calling the marker&#39;s tail position will be its head position at the time of the call, regardless of where the marker&#39;s head is moved.</p>
</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='name'>properties</span>
      &mdash;
      <span class='desc'>An optional hash of properties to associate with the marker.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='setHeadPosition-instance'>
      ::<strong>setHeadPosition</strong>(position, properties)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Sets the head position of the marker.</p>
</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='type'>(Point)</span>
      <span class='name'>position</span>
      &mdash;
      <span class='desc'>A <a href='Point.html'>Point</a> or point-compatible <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array'>Array</a>. The position will be clipped before it is assigned.</span>
    </li>
    <li>
      <span class='name'>properties</span>
      &mdash;
      <span class='desc'>An optional hash of properties to associate with the marker.</span>
    </li>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='setProperties-instance'>
      ::<strong>setProperties</strong>(properties)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Merges an <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'>Object</a> containing new properties into the marker&#39;s existing properties.</p>
</div>
<div class='tags'>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='setRange-instance'>
      ::<strong>setRange</strong>(range, properties)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Sets the range of the marker.</p>
</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='type'>(Range)</span>
      <span class='name'>range</span>
      &mdash;
      <span class='desc'>A <a href='Range.html'>Range</a> or range-compatible <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array'>Array</a>. The range will be clipped before it is assigned.</span>
    </li>
    <li>
      <span class='name'>properties</span>
      &mdash;
      <span class='desc'>An optional hash of properties to associate with the marker.</span>
    </li>
    <ul class='options'>
      <li>
        <span class='name'>reversed</span>
        &mdash;
        <span class='desc'>If true, the marker will to be in a reversed orientation.</span>
      </li>
    </ul>
  </ul>
</div>
  </div>
  <div class='method_details'>
    <p class='signature' id='setTailPosition-instance'>
      ::<strong>setTailPosition</strong>(position, properties)
      <a class='gh-link' href='https://github.com/atom/atom'>Source</a>
    </p>
    <div class='docstring'>
  <p>Sets the head position of the marker. If the marker doesn&#39;t have a tail, it will after calling this method.</p>
</div>
<div class='tags'>
  <h3>Parameters:</h3>
  <ul class='param'>
    <li>
      <span class='type'>(Point)</span>
      <span class='name'>position</span>
      &mdash;
      <span class='desc'>A <a href='Point.html'>Point</a> or point-compatible <a href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array'>Array</a>. The position will be clipped before it is assigned.</span>
    </li>
    <li>
      <span class='name'>properties</span>
      &mdash;
      <span class='desc'>An optional hash of properties to associate with the marker.</span>
    </li>
  </ul>
</div>
  </div>
</div>
    </div>
    <div id='footer'>
  Generated on
  Wed Feb 26 2014 17:43:10 GMT-0800 (PST)
  by
  <a href='https://github.com/gjtorikian/biscotto' title='TomDoc-CoffeeScript API documentation generator'>Biscotto</a>
  v2.1.0
  (Node.js v0.10.21).
  &#10034;
  Press Ctrl-h to see the keyboard shortcuts
</div>
  </body>
</html>